#!/bin/bash

echo nvidia|sudo sh max_cpu_freq.sh
sleep 1
echo nvidia|sudo sh max_gpu_freq.sh
sleep 1

sleep 1
#sudo chmod 777 /dev/ttyTHS0

gnome-terminal --tab -t "1-1_camera_pkg rflysim" -- bash -c "ros2 launch camera_pkg rflysim.launch;"

gnome-terminal --tab -t "1-2_mavros" -- bash -c "ros2 launch mavros px4.launch;"
sleep 8


gnome-terminal --tab -t "2_fcu_comm"  -- bash -c "ros2 launch fcu_comm fcu_comm.launch;"


sleep 5

gnome-terminal --tab -t "3_yolov5"  -- bash -c "cd ~/object-detection-yolov5; ./run_server.sh;"

sleep 5


gnome-terminal --tab -t "4_Cluster_formation_control"  -- bash -c "ros2 run new_cluster Cluster_formation_control_node_new;"


sleep 5

gnome-terminal --tab -t "5_DDS2ROS"  -- bash -c "cd ~/ros2_ws/install/dds2ros; ./DDS2ROS;"# sleep infinity;


sleep 5

gnome-terminal --tab -t "6_behavior-node"  -- bash -c "cd ~/ros2_ws; ros2 launch video_distribution video_distribution.launch.py;"

sleep 5

gnome-terminal --tab -t "7_vision_locate"  -- bash -c "ros2 launch fcu_comm vision_locate.launch;"

leep 5

gnome-terminal --tab -t "8_follow_attack"  -- bash -c "ros2 launch fcu_comm follow_attack.launch;"

leep 5

gnome-terminal --tab -t "9_video_distribution"  -- bash -c "ros2 run video_distribution video_distribution;"

sleep 1

gnome-terminal --tab -t "10_xe_thru"  -- bash -c "ros2 launch xe_thru x4m300.launch.xml;"

#sleep 5

#gnome-terminal -- bash -c "source /opt/ros/foxy/setup.bash; source ~/ros2_ws/install/setup.bash;  bash $basepath/check_restart.sh;"





